import request from '@/utils/request'

/**
 *
 * 获取组织架构数据
 *
*/
export function getDepartment() {
  return request({
    url: '/company/department'
  })
}

/**
 *
 *  获取部门负责人的数据
 * **/

export function getManagerList() {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 * 新增组织
 * ***/
export function addDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
/**
 * 修改部门
 * ***/
export function editDepartment(id, data) {
  return request({
    method: 'put',
    url: `/company/department/${id}`,
    data
  })
}
/**
 * 获取单个部门详情
 * ***/
export function getOneDepartment(id) {
  return request({
    url: `/company/department/${id}`

  })
}
/**
 * 删除部门
 * ***/
export function delOneDepartment(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

